package org.vnl.platform.service.rule;

import org.vnl.platform.dk.util.PDKException;
import org.vnl.platform.dk.util.PDKRuntimeException;

public class RuleRuntimeException extends PDKRuntimeException {


    /**
     * 
     */
    private static final long serialVersionUID = 7168926605204873634L;
    
    
    private static final String SYSTEM_ID = "PDKRULE";
    public static final String DEFAULT_BUNDLE_NAME = "resource.org.vnl.platform.service.Rule";
    
    public RuleRuntimeException(RuleErrCode code) {
        super(SYSTEM_ID,code.toString(),code.getSeverityString(), null, null);
    }

    public RuleRuntimeException(RuleErrCode code, Object[] parameters) {
        super(SYSTEM_ID,code.toString(),code.getSeverityString(), parameters, null);
    }

    public RuleRuntimeException(RuleErrCode code, Throwable cause) {
        super(SYSTEM_ID,code.toString(),code.getSeverityString(), null, cause);
    }
    
    public RuleRuntimeException(RuleErrCode code, Object[] parameters, Throwable cause) {
        super(SYSTEM_ID,code.toString(),code.getSeverityString(), parameters, cause);
    }

    public RuleRuntimeException(PDKException e) {
        super(e.getSystemId(),e.getMessage(),e.getSeverity(),e.getParameters(),e);
    }

    public RuleRuntimeException(PDKRuntimeException e) {
        super(e.getSystemId(),e.getMessage(),e.getSeverity(),e.getParameters(),e);
    }
    
    @Override
    protected String getDefaultBundleName() {
        return DEFAULT_BUNDLE_NAME;
    }

}
